#include <unistd.h>

static char *path()
{
	static char p[BUFSIZ] = {0};

	if (*p == 0)
		if(readlink("/proc/self/exe", p, sizeof(p)) < 0)
			*p = 0;

	return p;
}

/*

if (*(p = path()) != 0) {
	p = strdup(p);
	chdir(dirname(p));
	free(p);
	p = NULL;
}

*/
/////////////////////////////////////////////////////////


